<ui:composition template="/WEB-INF/templates/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="conteudo">
		<h:form id="form">
			<p:panel id="panel" header="Consulta">
				<h:inputHidden value="#{consultaBean.consulta.id}" />
				<h:panelGrid columns="3" >
					<p:outputLabel value="Nome do Paciente: " for="nomePaciente" />
					<p:inputText id="nomePaciente" value="#{consultaBean.pacienteId}" />
					<p:message for="nomePaciente" />

					<p:outputLabel value="Medico responsavel: " for="medico" />
					<p:inputText id="medico" value="#{consultaBean.medicoId}" />
					<p:message for="medico" />
					
					
					<p:outputLabel value="Clinica: " for="clinica" />
					<p:selectOneMenu id="clinica" value="#{consultaBean.clinicaId}" effect="fade"  >
						<f:selectItem itemLabel="Selecionar" itemValue="" />
						<f:selectItems value="#{logAIBean.instituicoes}" var="clinica"
							itemLabel="#{clinica.nome}" itemValue="#{clinica.id}" />
					</p:selectOneMenu>
					<p:message for="clinica" />
					
					<p:outputLabel value="Data de Atedimento: " for="dataAg" />
					<p:calendar id="dataAg"
						value="#{consultaBean.consulta.dataAtend}" mode="inline" pattern="dd/MM/yyyy HH:mm"/>
					<p:message for="dataAg" />
					
					<p:outputLabel value="Observações Atendente: " for="info" />
					
					<p:inputTextarea id="info"
						value="#{consultaBean.consulta.infoAtendenteConsulta}" />
					<p:message for="info" />


				</h:panelGrid>
				<p:commandButton value="Cadastrar"
					actionListener="#{consultaBean.add}" update="form" />
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>